import Cookies from 'js-cookie'

const TokenKey = 'TOKEN'

export function getCookies () {
	return Cookies.get(TokenKey)
}

export function setCookies (token) {
	return Cookies.set(TokenKey, token)
}

export function removeCookies () {
	return Cookies.remove(TokenKey)
}

export function getStorage (key) {
	if (key) return JSON.parse(localStorage.getItem(key))
}

export function setStorage (key, token) {
	if (key) return localStorage.setItem(key, JSON.stringify(token))
}

export function removeStorage (key) {
	if (key) return localStorage.removeItem(key)
}
